#ifndef __SESSION_H
#define __SESSION_H

#include <cstdlib>
#include <iostream>
#include <boost\bind.hpp>
#include <boost\asio.hpp>
#include <boost\algorithm\string.hpp>


#include <vector>

#include "Message.h"



using boost::asio::ip::tcp;
using namespace std;

class Session
{

private:
	tcp::socket socket_;
	enum{ MAX_LENGTH = 1024};
	char data_[MAX_LENGTH];
	vector<pair<string, Message> > *messages;
	

	void HandleRead(const boost::system::error_code &error,
		size_t bytesTransfered);
	void HandleWrite(const boost::system::error_code &error);

public:
	Session(boost::asio::io_service &ioService, vector<pair<string,Message>> *messages);
	tcp::socket& Socket();
	void Start();


};

#endif